#include<bits/stdc++.h>
using namespace std;
int a[100005],b[100005],c[100005];
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    int n,cnt=1,res=1,ans;
    cin>>n;
    ans=n;
    for(int i=1;i<=n;i++)cin>>a[i];
    sort(a+1,a+1+n);
    for(int i=2;i<=n;i++){
        if(a[i]!=a[i-1]){
            b[res++]=cnt;
            cnt=1;
        }
        else cnt++;
    }
    b[res]=cnt;
    for(int i=1;i<=res;i++)c[i]=c[i-1]+b[i];
    for(int i=2;i<=res;i++){
        if(b[i]>c[i-1]-n+ans)ans-=c[i-1]-n+ans;
        else ans-=b[i];
    }
    cout<<ans;
    return 0;
}
